<?php
/**
 * Cube PHP Framework
 * 
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 * 
 * @author Dillen / Steffen
 */

namespace Library\Web;

/**
 * @class Library.Web.Cookies
 * 
 * Cookies class
 */
class Cookies extends \Library\ArrayObject
{
	public function __construct()
	{
		$this->_storage = $_COOKIE;		
	}
	
	public function clear()
	{
		$this->_storage = array();
	}
	
	public function __destruct()
	{
		foreach($this->_storage as $key => $value)
		{
			setCookie($key, $value, time() + 3600);
		}
	}
}